package exam.day37;

public class Test1 {
    public static void main(String[] args) {
        solve("youzan", "zanyou");
    }
    public static boolean solve (String A, String B) {
        // write code here
        int n = A.length();
        for(int i = 0; i <= n; i++) {
            String s =  A.substring(i, n) + A.substring(0, i);
            if(s.equals(B)) {
                return true;
            }
            System.out.println(s);
        }

        return false;
    }
}
